<template>
  <div id="viptop">
    <div class="header">
      <div class="left" @click="back()">&lt;</div>
      <div class="center_title">
        <b></b>
      </div>
      <div class="right" @click="showShare = true">
        <img src="../../../../public/ycbimg/fenxiang.png" alt>
      </div>
      <van-share-sheet v-model="showShare" title="立即分享给好友" :options="options" @select="onSelect"/>
    </div>
  </div>
</template>

<script>
import { ShareSheet } from "vant";
export default {
  components: {
    [ShareSheet.name]: ShareSheet
  },
  data() {
    return {
      showShare: false,
      options: [
        { name: "微信", icon: "wechat" },
        { name: "微博", icon: "weibo" },
        { name: "复制链接", icon: "link" },
        { name: "分享海报", icon: "poster" },
        { name: "二维码", icon: "qrcode" }
      ]
    };
  },
  methods: {
    back() {
      this.$router.history.go(-1);
    },
    onSelect(option) {
      console.log(option);
      this.showShare = false;
    }
  }
};
</script>

<style scoped>
#viptop {
  width: 100%;
  height: 0.5rem;
  position: fixed;
  z-index: 999;
  top: 0;
  background-color: #ffffff;
}
.left {
  width: 0.5rem;
  height: 0.5rem;
  float: left;
  font-size: 0.16rem;
  text-align: center;
  line-height: 0.5rem;
}
.center_title {
  width: 2.75rem;
  height: 0.5rem;
  font-size: 16px;
  float: left;
  text-align: center;
  line-height: 0.5rem;
}
.right {
  width: 0.5rem;
  height: 0.5rem;
  float: left;
  font-size: 0.16rem;
  text-align: center;
  line-height: 0.5rem;
}
.right img {
  width: 0.2rem;
  height: 0.2rem;
}
</style>
